import cv2
import numpy as np

image1 = cv2.imread('input1.jpg')
image2 = cv2.imread('input2.jpg')

weightedSum = cv2.addWeighted(image1, 0.5, image2, 0.4, 0)

# sub = cv2.substract(image1, image2)
# add = cv2.add(image1, image2)

# 位运算
# dest = cv2.bitwise_and(image1, image2, mask = None)
# dest = cv2.bitwise_or(image1, image2, mask = None)
# dest = cv2.bitwise_xor(image1, image2, mask = None)
# dest = cv2.bitwise_not(image1, mask = None)

cv2.imshow('weighted image', weightedSum)
cv2.waitKey(0)
cv2.destroyAllWindows()